*******************************************************
*  Government Ideology and Bailout Conditionality     *
*  in the European Financial Crisis                   *  
*                                                     *
*  Genovese (fgenov@essex.ac.uk) and Hermida-Rivera   * 
*                                                     *        
*  This Version: May 12, 2022                         *          
*  Code run in Stata 13                               *
*******************************************************

clear all

* Set a working directory, install graph package "blindschemes" and open the main dataframe
* ssc install blindschemes

set scheme plottig

* set seed for clarify simulations
set seed 98034


cd "/Users/genovesefederica/Dropbox/bailouts/Submissions/II Final/GenoveseHermidaRivera_ii_replication/"

use "GenoveseHermidaRivera_dataset.dta", clear

xtset country_id quarter_id
set more off

gen A_government_partisanship = l2.government_partisanship
gen B_government_partisanship = l2.dpi_execrlc
gen M_sovereign_debt = d.l4.sovereign_debt
gen M_bop = d.l4.bop
gen M_sovereign_interest_rate = d.l4.sovereign_interest_rate
gen quarter_id_sq = c.quarter_id#c.quarter_id
global xvar "A_government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate"
global x2var "B_government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate"

label variable A_government_partisanship "Government Partisanship (L-R)"
label variable M_sovereign_debt "Public Debt (t-4)"
label variable M_bop "Balance of Payments (t-4)"
label variable M_sovereign_interest_rate "Interest Rate (t-4)"
label variable quarter_id "Time Spline"
label variable quarter_id_sq "Quadratic Time Spline"
label variable financial_conditions "main"
label variable pub_labour_conditions "main"
label variable nonpub_labour_conditions "main"

* Table 2 - summary statistics
xtsum  financial_conditions pub_labour_conditions nonpub_labour_conditions sum_conditions ///
	government_partisanship sovereign_debt bop sovereign_interest_rate

* Figure 1 - Financial conditions across countries and time
xtline financial_conditions if quarter_id>3, ov ///
	legend(label(1 "Ireland") label(2 "Greece") ///
	label(3 "Spain") label(4 "Cyprus") label(5 "Latvia") label(6 "Hungary") ///
	label(7 "Portugal") label(8 "Romania")) ///
	plot2opts(lp(dash)) plot3opts(lp(dash_dot)) plot7opts(lp(longdash)) plot8opts(lp(shortdash)) ///
	xtitle("Quarter") ytitle("Bailout Conditionality: Financial Conditions") ///
	xlabel(0 "Q42007" 10 "Q42009" 20 "Q42011" 30 "Q42013" 40 "Q42015")

* Figure 2 - Public Sector Labour conditions across countries and time
xtline pub_labour_conditions if quarter_id>3, ov legend(label(1 "Ireland") label(2 "Greece") ///
	label(3 "Spain") label(4 "Cyprus") label(5 "Latvia") label(6 "Hungary") ///
	label(7 "Portugal") label(8 "Romania")) ///
	plot2opts(lp(dash)) plot3opts(lp(dash_dot)) plot7opts(lp(longdash)) plot8opts(lp(shortdash)) ///
	xtitle("Quarter") ytitle("Bailout Conditionality: Public Sector Labour Conditions") ///
	xlabel(0 "Q42007" 10 "Q42009" 20 "Q42011" 30 "Q42013" 40 "Q42015")

* Table 3 -  ZINB models with country-clustered SE (argaining period at the inflation stage)
tab ongoing_bailout
tab true_zeroes

eststo m1:  zinb financial_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(95)
eststo m2:  zinb pub_labour_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(95)
eststo m3 :  zinb nonpub_labour_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(95)
eststo m4:  zinb sum_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(95)
esttab m1 m2 m3 m4, star(* 0.05 ** 0.01) se stats(aic N N_zero N_clust)  
eststo clear

* Figure 3 - margin plots

* Finance conditions 
zinb financial_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(95)
estat ic
margins, at (A_government_partisanship=(2(0.1)8)) post
estimates store fifth
estimates store fifth2
marginsplot, recast(line) ytitle("Predicted Number of Conditions") title("Bailout Conditionality: Financial Sector Conditions")
* Public sector labour conditions
zinb pub_labour_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(95)
estat ic
margins, at (A_government_partisanship=(2(0.1)8)) post
estimates store fifth
estimates store fifth2
marginsplot, recast(line) ytitle("Predicted Number of Conditions") title("Bailout Conditionality: Public Sector Labour Conditions")

* Table 4 - alternative specification models

eststo m1:  zinb financial_conditions A_government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate i.country_id quarter_id quarter_id_sq if  ongoing_bailout==1, inflate(_cons) cluster(country_id)
eststo m2:  zinb pub_labour_conditions A_government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate i.country_id quarter_id quarter_id_sq if  ongoing_bailout==1, inflate(_cons) cluster(country_id) 
eststo m3:  poisson financial_conditions A_government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate i.country_id quarter_id quarter_id_sq if financial_conditions>0,  cluster(country_id)
eststo m4:  poisson pub_labour_conditions A_government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate i.country_id quarter_id quarter_id_sq if pub_labour_conditions>0,  cluster(country_id)
esttab m1 m2 m3 m4, star(* 0.05 ** 0.01) se stats(aic N N_zero N_clust)  

* Figure 4 - First difference approach (with poisson regressions in Table 4)

* net describe clarify, from(http://gking.harvard.edu/clarify) 
sum A_government_partisanship 

gen cyprus=1 if country == "CYPRUS" 
replace cyprus=0 if country != "CYPRUS" 
gen greece=1 if country == "GREECE" 
replace greece=0 if country != "GREECE" 
gen hungary=1 if country == "HUNGARY" 
replace hungary=0 if country != "HUNGARY" 
gen ireland=1 if country == "IRELAND" 
replace ireland=0 if country != "IRELAND" 
gen latvia=1 if country == "LATVIA" 
replace latvia=0 if country != "LATVIA" 
gen portugal=1 if country != "PORTUGAL" 
replace portugal=0 if country != "PORTUGAL" 
gen romania=1 if country == "ROMANIA" 
replace romania=0 if country != "ROMANIA" 
gen spain=1 if country == "SPAIN" 
replace spain=0 if country != "SPAIN" 

* Simulations based on Government Partisanship increase from mean by one standard deviation

* Financial conditions
estsimp  poisson financial_conditions A_government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate cyprus greece hungary ireland latvia romania  quarter_id quarter_id_sq ,  cluster(quarter_id)
setx median 
simqi, fd(prval(1)) changex(A_government_partisanship 5.370956 7.071987) level(83)
drop b1-b13
drop if country_id == .

* Public sector labor conditions
estsimp  poisson pub_labour_conditions A_government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate cyprus greece hungary ireland latvia romania  quarter_id quarter_id_sq ,  cluster(quarter_id)
setx median 
simqi, fd(prval(1)) changex(A_government_partisanship 5.370956 7.071987) level(83)
drop b1-b13
drop if country_id == .

gen v1=0.5
gen v2=0.75

gen b1=  -.075684
gen lb1= -.2022809
gen ub1= .0051821

gen b2=  .0967822 
gen lb2= .0321839
gen ub2=  .1622722
 
twoway (scatter v1 b1, mcolor(black) msymbol(smcircle)) (rcap lb1 ub1 v1, lcolor(black) lpattern(l) ///
	horizontal msize(zero) mcolor(black) msymbol(smcircle)) (scatter v2 b2, mcolor(black) msymbol(smcircle)) ///
	(rcap lb2 ub2 v2, lcolor(black) lpattern(l) horizontal msize(zero) mcolor(black) msymbol(smcircle)), xline(0, lpattern(dash)) ///
	ylabel(0.25 " " 0.5 "Financial sector conditions"  0.75 "Public sector labour conditions " 1 " ", noticks angle(0)) ///
	ytitle(`"Probability Change with 1 SD"' `"Increase in Partisanship (L-R)"') xtitle(First Difference Estimates) ///
	xlabel(-0.3(0.1)0.3, format(%03.1f)) legend(off) scheme(lean1) aspectratio(1)

************
* APPENDIX *
************

* Figure A.2 - Sum of all conditions across countries and time
xtline sum_conditions if quarter_id>3, ov ///
	legend(label(1 "Ireland") label(2 "Greece") ///
	label(3 "Spain") label(4 "Cyprus") label(5 "Latvia") label(6 "Hungary") ///
	label(7 "Portugal") label(8 "Romania")) ///
	plot2opts(lp(dash)) plot3opts(lp(dash_dot)) plot7opts(lp(longdash)) plot8opts(lp(shortdash)) ///
	xtitle("Quarter") ytitle("Bailout Conditionality: Sum") ///
	xlabel(0 "Q42007" 10 "Q42009" 20 "Q42011" 30 "Q42013" 40 "Q42015")

* Figure A.3 - Sum of Non-public sector conditions across countries and time
xtline nonpub_labour_conditions if quarter_id>3, ov ///
	legend(label(1 "Ireland") label(2 "Greece") ///
	label(3 "Spain") label(4 "Cyprus") label(5 "Latvia") label(6 "Hungary") ///
	label(7 "Portugal") label(8 "Romania")) ///
	plot2opts(lp(dash)) plot3opts(lp(dash_dot)) plot7opts(lp(longdash)) plot8opts(lp(shortdash)) ///
	xtitle("Quarter") ytitle("Bailout Conditionality: Non-Public Sector Labour Conditions") ///
	xlabel(0 "Q42007" 10 "Q42009" 20 "Q42011" 30 "Q42013" 40 "Q42015")

* Figure A.4 through Figure A.7 - histograms (distribution) of conditions 
hist sum_conditions, percent kdensity bin(30) ytitle("Percentage (%)") xtitle("Bailout Conditionality: Sum")
hist financial_conditions, percent kdensity bin(30) ytitle("Percentage (%)") xtitle("Bailout Conditionality: Financial Conditions")
hist pub_labour_conditions, percent kdensity bin(30) ytitle("Percentage (%)") xtitle("Bailout Conditionality: Public Sector Labour Conditions")
hist nonpub_labour_conditions, percent kdensity bin(30) ytitle("Percentage (%)") xtitle("Bailout Conditionality: Non-Public Sector Labour Conditions")

hist sum_conditions if ongoing_bailout==1, percent kdensity bin(30) ytitle("Percentage (%)") xtitle("Bailout Conditionality: Sum")
hist financial_conditions if ongoing_bailout==1, percent kdensity bin(30) ytitle("Percentage (%)") xtitle("Bailout Conditionality: Financial Conditions")
hist pub_labour_conditions if ongoing_bailout==1, percent kdensity bin(30) ytitle("Percentage (%)") xtitle("Bailout Conditionality: Public Sector Labour Conditions")
hist nonpub_labour_conditions if ongoing_bailout==1, percent kdensity bin(30) ytitle("Percentage (%)") xtitle("Bailout Conditionality: Non-Public Sector Labour Conditions")

* Figure A.8 Unconditional effect of government partinsanship on financial conditions (no covariates)
separate financial_conditions, by(country)
twoway (scatter financial_conditions1 government_partisanship) (scatter financial_conditions2 government_partisanship) ///
	(scatter financial_conditions3 government_partisanship) (scatter financial_conditions4 government_partisanship) ///
	(scatter financial_conditions5 government_partisanship) (scatter financial_conditions6 government_partisanship) ///
	(scatter financial_conditions7 government_partisanship) (scatter financial_conditions8 government_partisanship) ///
	(lowess financial_conditions government_partisanship) if ongoing_bailout!=0, legend(label(1 "Cyprus") label(2 "Greece") ///
	label(3 "Hungary") label(4 "Ireland") label(5 "Latvia") label(6 "Portugal") ///
	label(7 "Romania") label(8 "Spain") label(9 "lowess fit")) ///
	xtitle("Government Partisanship") ytitle("Bailout Conditions: Finance") 

* Figure A.9 Unconditional effect of government partinsanship on public sector labour conditions (no covariates)
separate pub_labour_conditions, by(country)
twoway (scatter pub_labour_conditions1 government_partisanship) (scatter pub_labour_conditions2 government_partisanship) ///
	(scatter pub_labour_conditions3 government_partisanship) (scatter pub_labour_conditions4 government_partisanship) ///
	(scatter pub_labour_conditions6 government_partisanship) (scatter pub_labour_conditions7 government_partisanship) ///
	(scatter financial_conditions7 government_partisanship) (scatter pub_labour_conditions8 government_partisanship)  ///
	(lowess pub_labour_conditions government_partisanship) if ongoing_bailout!=0, legend(label(1 "Cyprus") label(2 "Greece") ///
	label(3 "Hungary") label(4 "Ireland") label(5 "Latvia") label(6 "Portugal") ///
	label(7 "Romania") label(8 "Spain") label(9 "lowess fit")) ///
	xtitle("Government Partisanship") ytitle("Bailout Conditionality: Public Sector Labour") 

* Table A.2 - quarter-clustered SE 
eststo m1:  zinb financial_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(quarter_id) 
eststo m2:  zinb pub_labour_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(quarter_id)
eststo m3:  zinb nonpub_labour_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(quarter_id)  
eststo m4:  zinb sum_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(quarter_id)  
esttab m1 m2 m3 m4, star(* 0.05 ** 0.01) se stats(aic N N_zero N_clust)  
eststo clear

* Table A.3 - Linear models (only onset of bailout bargaining quarters)
eststo:  reg financial_conditions $xvar i.country_id quarter_id quarter_id_sq if ongoing_bailout==1,  cluster(country_id)  level(90)
eststo:  reg pub_labour_conditions $xvar i.country_id quarter_id quarter_id_sq if ongoing_bailout==1,  cluster(country_id)  level(90)
eststo:  reg sum_conditions $xvar i.country_id quarter_id quarter_id_sq if ongoing_bailout==1,  cluster(country_id)  level(90)
eststo:  reg nonpub_labour_conditions $xvar i.country_id quarter_id quarter_id_sq if ongoing_bailout==1,  cluster(country_id)  level(90)
esttab , star(* 0.1 ** 0.05 *** 0.01) se stats(aic N N_zero N_clust)  
eststo clear

* Table A.4 - Population-averaged panel models for overdispersed dependent variables 
eststo:  xtnbreg financial_conditions $xvar i.country_id quarter_id quarter_id_sq if ongoing_bailout==1
eststo:  xtpoisson pub_labour_conditions $xvar i.country_id quarter_id quarter_id_sq if ongoing_bailout==1
eststo:  xtnbreg sum_conditions $xvar i.country_id quarter_id quarter_id_sq ongoing_bailout if ongoing_bailout==1
eststo:  xtnbreg nonpub_labour_conditions $xvar i.country_id quarter_id quarter_id_sq ongoing_bailout if ongoing_bailout==1
esttab , star(* 0.1 ** 0.05 *** 0.01) se stats(aic N N_zero N_clust)  
eststo clear

* Table A.5 - Other lags of the government partisanship variable
sort country_id quarter_id
gen lgovernment_partisanship = l.government_partisanship
eststo:  zinb financial_conditions lgovernment_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(quarter_id) nolog level(90)
eststo:  zinb financial_conditions government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(quarter_id) nolog level(90)
eststo:  zinb pub_labour_conditions lgovernment_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(quarter_id) nolog level(90)
eststo:  zinb pub_labour_conditions government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(quarter_id) nolog level(90)
esttab , star(* 0.1 ** 0.05 *** 0.01) se stats(aic N N_zero N_clust)  
eststo clear

* Table A.6 - Twice-lagged versions of the macroeconomic control variables
gen M_sovereign_debt_alt = d.l2.sovereign_debt
gen M_bop_alt = d.l2.bop
gen M_sovereign_interest_rate_alt = d.l2.sovereign_interest_rate
gen M_sovereign_debt_alt2 = d.l3.sovereign_debt
gen M_bop_alt2 = d.l3.bop
gen M_sovereign_interest_rate_alt2 = d.l3.sovereign_interest_rate
global x3var "A_government_partisanship M_sovereign_debt_alt M_bop_alt M_sovereign_interest_rate_alt"

eststo m1:  zinb financial_conditions $x3var i.country_id quarter_id quarter_id_sq, inflate( _cons) cluster(country_id) 
eststo m2:  zinb pub_labour_conditions $x3var i.country_id quarter_id quarter_id_sq, inflate( _cons) cluster(country_id) 
esttab m1 m2 , star(* 0.1 ** 0.05 *** 0.01) se stats(aic N N_zero N_clust)  
eststo clear

* Table A.7 - Government indebtedness towards the domestic financial sector 
gen ln_liabilities = ln(finance_liabilities_govt)
gen d_ln_liabilities = d.l4.ln_liabilities
gen l_ln_liabilities = l4.ln_liabilities

global xvar_new "A_government_partisanship d_ln_liabilities M_sovereign_debt M_bop M_sovereign_interest_rate"
eststo m1:  zinb financial_conditions $xvar_new  i.country_id quarter_id quarter_id_sq, inflate( _cons) cluster(country_id) nolog level(90)
eststo m2:  zinb pub_labour_conditions $xvar_new i.country_id quarter_id quarter_id_sq, inflate( _cons) cluster(country_id) nolog level(90)
esttab m1 m2, star(* 0.1 ** 0.05 *** 0.01) se stats(aic N N_zero N_clust) 
eststo clear

* Table A.8 - alternative measure of executive ideology (i.e. DIP)
eststo:  zinb financial_conditions $x2var i.country_id quarter_id quarter_id_sq , inflate(ongoing_bailout _cons) cluster(country_id) nolog level(90)
eststo:  zinb pub_labour_conditions $x2var i.country_id quarter_id quarter_id_sq , inflate(ongoing_bailout _cons) cluster(country_id) nolog level(90)
esttab , star(* 0.1 ** 0.05 *** 0.01) se stats(aic N N_zero N_clust)  
eststo clear

* Table A.9 - EMU-only countries (no Hungary and Romania)
eststo m1 : zinb financial_conditions $xvar i.country_id quarter_id quarter_id_sq if  country_id!=6 & country_id!=8, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(90)
eststo m2: zinb pub_labour_conditions $xvar i.country_id quarter_id quarter_id_sq if  country_id!=6 & country_id!=8, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(90)
esttab m1 m2 , star(* 0.1 ** 0.05 *** 0.01) se stats(aic N N_zero N_clust)  
eststo clear

* Table A.10 - Controlling for gross capital inflows (FDI) and unionization level
global xvar "A_government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate "

gen lag_unionization = l.unionization
gen d_unionization = d.unionization
label variable lag_unionization "Trade union density rate (%). 1-quarter lag"
gen lag_fdi = l.fdi_perc
gen d_fdi = d.fdi_perc
label variable lag_fdi "Foreign direct investment, net inflows (% of GDP). 1-quarter lag"

eststo:  zinb financial_conditions $xvar lag_fdi  d_fdi  i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) 
eststo:  zinb pub_labour_conditions $xvar lag_unionization d_unionization i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) 
esttab , star(* 0.1 ** 0.05 *** 0.01) se stats(aic N N_zero N_clust)  
eststo clear

* Table A.11 - Controlling for unemployment (at the quarter level) or public sector unempl and youth unemployment (yearly level)
gen d_public_sector_unempl = d.l4.public_sector_unempl
gen l_public_sector_unempl = l4.public_sector_unempl
gen d_youth_unempl = d.l4.youth_unempl
gen l_youth_unempl = l4.youth_unempl
gen d_unempl_quarter= d.l4.unempl_quarter
gen l_unempl_quarter= l4.unempl_quarter

eststo m1:  zinb financial_conditions $xvar  l_youth_unempl d_youth_unempl d_public_sector_unempl l_public_sector_unempl i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(95)
eststo m2:  zinb pub_labour_conditions $xvar l_youth_unempl d_youth_unempl d_public_sector_unempl l_public_sector_unempl i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(95)
eststo m3 :  zinb financial_conditions $xvar d_unempl_quarter l_unempl_quarter i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(95)
eststo m4:  zinb pub_labour_conditions $xvar d_unempl_quarter l_unempl_quarter i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(95)
esttab m1 m2 m3 m4, star(* 0.1 ** 0.05 *** 0.01) se stats(aic N N_zero N_clust) 
eststo clear

* Table A.12 - Controlling for government (expected and unexpected) turnover
global xvar "A_government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate gov_turnover"
global xvar1 "A_government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate gov_turnover_unexp"

eststo:  zinb financial_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(90)
eststo:  zinb financial_conditions $xvar1 i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(90)
eststo:  zinb pub_labour_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(90)
eststo:  zinb pub_labour_conditions $xvar1 i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(90)
esttab , star(* 0.1 ** 0.05 *** 0.01) se stats(aic N N_zero N_clust)  
eststo clear

* Table A.13 - Errors clustered around cabinets
global xvar "A_government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate"

eststo m1:  zinb financial_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(cabinet) 
eststo m2:  zinb pub_labour_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(cabinet) 
eststo m3:  zinb nonpub_labour_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(cabinet)
eststo m4:  zinb sum_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(cabinet) 
esttab m1 m2 m3 m4, star(* 0.1 ** 0.05 *** 0.01)  se stats(aic N N_zero N_clust)  
eststo clear

* Table A.14 - Substituting government partisanship with a measure of ideological cohesion in the cabinet (QoG CPDS Schmidt Index Measure)
global xvar "i.cpds_govlr M_sovereign_debt M_bop M_sovereign_interest_rate"

eststo:  zinb financial_conditions $xvar i.country_id, inflate(_cons) cluster(country_id)
eststo:  zinb financial_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(_cons) cluster(country_id) 
eststo:  zinb pub_labour_conditions $xvar i.country_id, inflate(_cons) cluster(country_id)
eststo:  zinb pub_labour_conditions $xvar i.country_id quarter_id quarter_id_sq, inflate(_cons) cluster(country_id) 
esttab , star(* 0.1 ** 0.05 *** 0.01) se stats(aic N N_zero N_clust)  
eststo clear

* Table A.15 - Controlling for finance ministry's partisan ideology
gen l_m_finance =  l2.m_finance
gen ldebt = l4.sovereign_debt
gen lbop = l4.bop
gen linterest = l4.sovereign_interest_rate
global xvar "A_government_partisanship M_sovereign_debt M_bop M_sovereign_interest_rate"
eststo m1:  zinb financial_conditions $xvar    l_m_finance i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(95)
eststo m2:  zinb financial_conditions $xvar ldebt lbop linterest  l_m_finance i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(95)
eststo m3:  zinb pub_labour_conditions $xvar   l_m_finance i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(95)
eststo m4:  zinb pub_labour_conditions $xvar ldebt lbop linterest  l_m_finance i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(95)
esttab m1 m2 m3 m4, star(* 0.1 ** 0.05 *** 0.01) se stats(aic N N_zero N_clust)  
eststo clear

* Table A.16 - Error Correction Model (levels and first differences of covariates)
gen d_government_partisanship = d.l2.government_partisanship

eststo:  zinb financial_conditions A_government_partisanship  d_government_partisanship ldebt lbop linterest  M_sovereign_debt M_bop M_sovereign_interest_rate i.country_id, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(90)
eststo:  zinb financial_conditions A_government_partisanship d_government_partisanship ldebt lbop linterest M_sovereign_debt M_bop M_sovereign_interest_rate i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(90)
eststo:  zinb pub_labour_conditions A_government_partisanship d_government_partisanship ldebt lbop linterest  M_sovereign_debt M_bop M_sovereign_interest_rate i.country_id, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(90)
eststo:  zinb pub_labour_conditions A_government_partisanship d_government_partisanship ldebt lbop linterest  M_sovereign_debt M_bop M_sovereign_interest_rate i.country_id quarter_id quarter_id_sq, inflate(ongoing_bailout _cons) cluster(country_id) nolog level(90)
esttab , star(* 0.1 ** 0.05 *** 0.01) se stats(aic N N_zero N_clust)  
eststo clear

* Table A.17 -  Interactions between government partisanship and macroeconomic covariates
eststo:  zinb financial_conditions c.A_government_partisanship##c.M_sovereign_debt c.A_government_partisanship##c.M_bop c.A_government_partisanship##c.M_sovereign_interest_rate i.country_id quarter_id quarter_id_sq , inflate(ongoing_bailout _cons) cluster(country_id)  level(90)
eststo:  zinb pub_labour_conditions c.A_government_partisanship##c.M_sovereign_debt c.A_government_partisanship##c.M_bop c.A_government_partisanship##c.M_sovereign_interest_rate i.country_id quarter_id quarter_id_sq , inflate( ongoing_bailout _cons) cluster(country_id)  level(90)
esttab, star(* 0.1 ** 0.05 *** 0.01) se stats(aic N N_zero N_clust)  
eststo clear
